package com.core.image.core.box;

import com.core.image.core.SendPacket;

import java.io.ByteArrayInputStream;

/**
 * describe:
 *
 * @author 库琦
 * @date 2020/01/29
 */
public class ByteSendPacket extends SendPacket<ByteArrayInputStream> {
    private final byte[] bytes;
    public ByteSendPacket(byte[] bytes){
        this.bytes = bytes;
        this.length = bytes.length;
    }
    @Override
    public ByteArrayInputStream createStream() {
        return new ByteArrayInputStream(bytes);
    }
    @Override
    public byte type() {
        return TYPE_MEMORY_BYTES;
    }
}
